package com.io;


import java.io.*;

/**
 * @Author weijingchen
 * @Date 2025/6/16 19:55
 * @Version 1.0.0
 */
public class Test01 {
    public static void main(String[] args) throws IOException {

        test01(new File("Test/src/main/resources/a.txt"));
    }


    public static void test01(File file) throws IOException {
        // 创建一个输出流
        OutputStream fos = new FileOutputStream(file);
        // 写入数据
        fos.write(97);
        fos.write("\n".getBytes());
        fos.write("hello world".getBytes());
        // 关闭流
        fos.close();
    }
}
